import http from '@/utils/http'
import { useAuthStore } from '@/store/auth'
import { storeToRefs } from 'pinia'

const authStore = useAuthStore()
const { globalParams, historyParams } = storeToRefs(authStore)
export const getCameraList = (params: any) => {
  if (globalParams.value.startTime) {
    return http.postOrJson('/video/his/dataList', { ...globalParams.value, ...params })
  }
  return http.postOrJson('/video/cameraList', { ...globalParams.value, ...params })
}
// 根据点位ID获取视频和基站列表详情
export const getAnnotationJzAndVideoList = (id: string) => {
  return http.get('/tunnel/getAnnotationJzAndVideoList', { params: { ...globalParams.value, ...historyParams.value, id }})
}

export const getFlvUrl = (data) => {
  return http.get('/video/getHttpFlvUrl', {
    params: data
  })
}